package sunbao.ido.experimentalField.listener;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * \* User: MeiZhongHao
 * \* Date: 2018-11-13
 * \* Time: 18:08
 * \* Description:
 * \
 */
@Component
public class RegisterListener implements ApplicationListener<UserRegisterEvent> {


    @Override
    public void onApplicationEvent(UserRegisterEvent userRegisterEvent) {
        //获取注册用户对象
        UserBean user = userRegisterEvent.getUser();

        //输出注册用户信息
        System.out.println("注册信息，用户名："+user.getName()+"，密码："+user.getPassword());
    }
}